﻿using Janus.Mes.POCO;
using Janus.Mes.Repositories.iBatis;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace Janus.Mes.SqlDal
{
    public partial class IndicatorDal : iBatisRepository<Indicator>
    {      
        public IList<Indicator> FillAll()
        {
            //Expression<Func<Indicator, Indicator>> updater = (c => new Indicator (){ AddDate=c.AddDate });

            var p = new Dictionary<string, object>();
            p.Add("Where", "CreateDt>='2012-11-15'");
            var model = new Indicator() { IndicatorName = "testsss" };
            Hashtable ht = new Hashtable();
            ht.Add("startDate", "2012-03-01 00:00:00");
            ht.Add("endDate", "2012-12-12 23:59:59");
            ht.Add("IndicatorName", "质量");
            ht.Add("IndicatorName2", "1=2");
            
            var sql = base.GetSql(this.FindAllStatement, ht);
            var result = base.Context.QueryForList<Indicator>(this.FindAllStatement, ht);
            return result;
        }

        public void GetCount()
        {
            Hashtable ht = new Hashtable();
            ht.Add("startDate", "2012-03-01 00:00:00");
            ht.Add("endDate", "2012-12-12 23:59:59");
            ht.Add("IndicatorName", null);
            var result = base.Context.QueryForList("Indicator.SelCount", ht);
        }
    }
}
